import request from '@/utils/request';


export async function listByItemId(projectId, type, itemId) {
    return request(`/project/${projectId}/itemRel/listRel`, {
        params: {
            relItemType: type,
            projectItemId: itemId
        }
    });
}

export async function listByRelItemId(projectId, type, relItemId) {
    return request(`/project/${projectId}/itemRel/listItem`, {
        params: {
            relItemType: type,
            relItemId: relItemId
        }
    });
}

export async function addRelItem(projectId, type, itemId,relItemId){
    return request(`/project/${projectId}/itemRel`, {
        method:"POST",
        data: {
            projectId:projectId,
            relItemType:type,
            relItemId:relItemId,
            projectItemId:itemId
        }
    });
}

export async function delRelItem(projectId, type, itemId,relItemId){
    return request(`/project/${projectId}/itemRel`, {
        method:"DELETE",
        data: {
            projectId:projectId,
            relItemType:type,
            relItemId:relItemId,
            projectItemId:itemId
        }
    });
}